<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<!-- 网页使用的语言 -->
<html lang="zh-CN">
<head>
    <!-- 指定字符集 -->
    <meta charset="utf-8">
    <!-- 使用Edge最新的浏览器的渲染方式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- viewport视口：网页可以根据设置的宽度自动进行适配，在浏览器的内部虚拟一个容器，容器的宽度与设备的宽度相同。
    width: 默认宽度与设备的宽度相同
    initial-scale: 初始的缩放比，为1:1 -->
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <title>Bootstrap模板</title>

    <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">

    <!-- 可选的 Bootstrap 主题文件（一般不用引入） -->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">

    <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
    <style type="text/css">
        td, th {
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container">
    <h3 style="text-align: center">显示所有联系人</h3>
    <table border="1" class="table table-bordered table-hover">
        <tr class="success">
            <th>编号</th>
            <th>姓名</th>
            <th>性别</th>
            <th>年龄</th>
            <th>籍贯</th>
            <th>QQ</th>
            <th>邮箱</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${pageBean.linkManList}" var="linkMan" varStatus="s">
            <tr>
                <td>${s.count}</td>
                <td>${linkMan.name}</td>
                <td>${linkMan.sex}</td>
                <td>${linkMan.age}</td>
                <td>${linkMan.address}</td>
                <td>${linkMan.qq}</td>
                <td>${linkMan.email}</td>
                <td><a class="btn btn-default btn-sm" href="修改联系人.html">修改</a>&nbsp;<a class="btn btn-default btn-sm" href="修改联系人.html">删除</a></td>
            </tr>
        </c:forEach>
        <tr>
            <td colspan="8" align="center">
                总共${pageBean.totalPage}页，共${pageBean.totalSize}条
				<ul class="pagination success">
                    <c:if test="${pageBean.currentPage>1}">
                       <li> <a href="/linkman?action=findByPage&currentPage=${pageBean.currentPage-1}&pageSize=${pageBean.pageSize}" aria-label="Previous"><span aria-hidden="true">&laquo;</span></a><li>
                    </c:if>
					<c:forEach begin="1" end="${pageBean.totalPage}" var="i">
                        <c:if test="${i==pageBean.currentPage}">
                        <li class="active"><a href="/linkman?action=findByPage&currentPage=${i}&pageSize=${pageBean.pageSize}">${i}</a><li>
                        </c:if>
                        <c:if test="${i!=pageBean.currentPage}">
                        <li><a href="/linkman?action=findByPage&currentPage=${i}&pageSize=${pageBean.pageSize}">${i}</a><li>
                        </c:if>
                    </c:forEach>
					<c:if test="${pageBean.currentPage!=pageBean.totalPage}">
                        <li><a href="/linkman?action=findByPage&currentPage=${pageBean.currentPage+1}&pageSize=${pageBean.pageSize}" aria-label="Next"><span aria-hidden="true">&raquo;</span></a><li>
                    </c:if>
				</ul>
            </td>
        </tr>
    </table>
</div>
</body>
</html>
